<?php
/**
 * /nmox/main/nmox.php
 * 
 * NMOX PHP-MAX SERVER
 * This file is the only one needed for inclusion on all of your site pages to
 * have full access to all of the NMOX features. YOU MUST EDIT THIS FILE BY
 * HAND. Don't worry, there are only two sections you need to edit:
 * 
 * A) See the section below titled "Set NMOX folder name"? You may leave that
 * alone if you plan to allow the default NMOX installation. The only reasons to
 * change this would be 1) creating multiple installations of NMOX on the same
 * server (probably not the best idea), 2) if you are planning other uses for a
 * folder called "nmox" on this site and therefore need it to remain available,
 * or 3) if you, for some reason, do not want NMOX installed under its default
 * name (in which case, make sure you are acting within the terms of the NMOX
 * license).
 * 
 * B) Next, look at the section titled "Set NMOX configuration". Here you must
 * specify the method by which NMOX stores and retrieves configuration settings.
 * The default is "hard", i.e. hard-coded. Other options include storing and
 * retrieving configuration settings in an XML file, a CSV file, a flat
 * (plain-text, 1 key=value per line) file, or defining your own format. Just be
 * sure to write in a handler for any new formats you may add.
 * 
 * 
 * @author David Christian Liedle <david.liedle@gmail.com>
 * @link   http://nmox.org/
 *
 */

################################################################################
#  Set NMOX folder name:   ###### Leave this alone unless you MUST change it!
#

if( !isset( $NMOX_ROOT_PATH ) ){
    
    // Remember, this may already have been set within /nmox/x.php first.
    $NMOX_ROOT_PATH_FOLDER = "/nmox"; //Set as NAME of the root NMOX folder
    
        if( isset($_SERVER['SUBDOMAIN_DOCUMENT_ROOT']) ){
            
            $NMOX_ROOT_PATH_BASE = $_SERVER['SUBDOMAIN_DOCUMENT_ROOT'];
            
        } elseif( isset($_SERVER['DOCUMENT_ROOT']) ){
            
            $NMOX_ROOT_PATH_BASE = $_SERVER['DOCUMENT_ROOT'];
            
        } else {
            
            die("NMOX Root Path Configuration Error! Check x.php and nmox.php");
            
        }
        
    $NMOX_ROOT_PATH = $NMOX_ROOT_PATH_BASE . $NMOX_ROOT_PATH_FOLDER;
    
}


################################################################################
# Set NMOX configuration: ###### Best choice: Use the .php file!
# Specify ONE hardcode config file below:
#

$NMOX_CONFIG_FILE  = "/config/config.php"; // for code lovers; efficient/secure
#$NMOX_CONFIG_FILE = "/config/config.csv"; // for spreadsheet lovers
#$NMOX_CONFIG_FILE = "/config/config.xml"; // for futuristic powers
#$NMOX_CONFIG_FILE = "/config/config.txt"; // for archaic compatibility
#
# ^ You will need to edit whichever config file you specified above. Open it ^
# in a text editor, set your information, then FTP it up to the server where you
# are installing NMOX Server PHP-MAX. Now that switchboard knows where to look
# for the config file, allow it to load all needed files:
require_once($NMOX_ROOT_PATH."/main/switchboard.php"); // Gets EVERYTHING


################################################################################
# Set error reporting
#

error_reporting($NMOX_ERROR_LEVEL);


################################################################################
# Test Block:
#

locateMe("/nmox/main/nmox.php");
